import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/home',
  },{
    path: '/home',
    name: 'home',
    component: () => import(/*webpackChunkName:'home'*/'../views/Home.vue'),
    redirect:'/home/home-content',
    children:[
      {
        path:"/home/home-content",
        name:'home-content',
        component:()=>import(/*webpackChunkName:'home'*/'../components/home-content.vue')
      },{
        path: '/home/changeCity',
        name: 'changeCity',
        component: () => import('../views/changeCity.vue')
      },{
        path: '/home/searchValue',
        name: 'searchValue',
        component: () => import('../views/searchValue.vue')
      },
      
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  routes
})

export default router
